package com.jianguozh.difs.framework.constant.enums;

import com.jianguozh.difs.framework.constant.SecurityConstant;

/**
 * 端枚举
 *
 * @author hanrs
 * @email 4076130@qq.com
 * @since 2022/3/10 15:33
 */
public enum ClientEnum {

    CLIENT_PC_CATERING("DIFS-PC-CATERING", SecurityConstant.AUTHORITY_TAG_CATERING_PC),
    CLIENT_PC_SUPERIOR("DIFS-PC-SUPERIOR", SecurityConstant.AUTHORITY_TAG_SUPERIOR_PC),
    CLIENT_PC_SUPPLIER("DIFS-PC-SUPPLIER", SecurityConstant.AUTHORITY_TAG_SUPPLIER_PC),
    CLIENT_PC_OPS("DIFS-PC-OPS", SecurityConstant.AUTHORITY_TAG_OPS_PC),

    CLIENT_H5_CATERING("DIFS-H5-CATERING", SecurityConstant.AUTHORITY_TAG_CATERING_H5),
    CLIENT_H5_SUPERIOR("DIFS-H5-SUPERIOR", SecurityConstant.AUTHORITY_TAG_SUPERIOR_H5),
    CLIENT_H5_SUPPLIER("DIFS-H5-SUPPLIER", SecurityConstant.AUTHORITY_TAG_SUPPLIER_H5),
    CLIENT_H5_OPS("DIFS-H5-OPS", SecurityConstant.AUTHORITY_TAG_OPS_H5),

    CLIENT_APP_AISCALE("DIFS-APP-AISCALE", SecurityConstant.AUTHORITY_TAG_AISCALE),
    CLIENT_APP_MORROBOT("DIFS-APP-MORROBOT", SecurityConstant.AUTHORITY_TAG_MORROBOT),
    CLIENT_APP_FODBOX("DIFS-APP-FODBOX", SecurityConstant.AUTHORITY_TAG_FODBOX),
    CLIENT_APP_FODPRT("DIFS-APP-FODPRT", SecurityConstant.AUTHORITY_TAG_FODPRT),

    ;

    private final String appId;

    private final String authorityTag;

    ClientEnum(String appId, String authorityTag) {
        this.appId = appId;
        this.authorityTag = authorityTag;
    }

    public static ClientEnum fromAppId(String appId) {
        ClientEnum[] clientEnums = values();

        for (int i = 0; i < clientEnums.length; ++i) {
            ClientEnum clientEnum = clientEnums[i];
            if (clientEnum.getAppId().equalsIgnoreCase(appId)) {
                return clientEnum;
            }
        }
        return null;

    }



    public String getAppId() {
        return appId;
    }

    public String getAuthorityTag() {
        return authorityTag;
    }}
